package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: hea7en
 * @Date: 2024/5/13 10:33 AM
 * @Description: 口味表Mapper
 */
@Mapper
public interface FlavorMapper {

    /**
     * 口味表批量保存
     * @param flavors
     */
    void saveBatch(List<DishFlavor> flavors);

    /**
     * 根据菜品id批量删除
     * @param ids
     */
    void deleteByDishIds(List<Long> ids);

    /**
     * 根据菜品id查询
     * @param dishId
     * @return
     */
    @Select("select * from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> getByDishId(Long dishId);
}
